<template>
  <div class="uploadImg">
    <img :src="src">
    <vue-core-image-upload :class="['pure-button','pure-button-primary','js-btn-crop']"
                           :crop="true"
                           text="上传图片"
                           url="http://127.0.0.1:5000/uploadimg/"
                           extensions="png,gif,jpeg,jpg"
                           @:imageuploading="imageuploading"
    >
    </vue-core-image-upload>
  </div>
</template>

<script>
  import VueCoreImageUpload from 'vue-core-image-upload'
  export default {
    name: 'uploadImg',
    data () {
      return {
        src: 'http://img1.vued.vanthink.cn/vued0a233185b6027244f9d43e653227439a.png'
      }
    },
    components: {
      VueCoreImageUpload
    },
    methods: {
      imageuploading: function (event) {
        console.log('asdfsad')
        if (event.errcode === 0) {
          console.log('--=-')
          this.src = 'http://img1.vued.vanthink.cn/vued751d13a9cb5376b89cb6719e86f591f3.png'
        }
      }
    }
  }
</script>
